UseRequestEventsPropsType
import { UseRequestEventsPropsType } from "@hyper-fetch/react"
Description
Defined in helpers/use-request-events/use-request-events.types.ts:21
Preview
type UseRequestEventsPropsType<T> = {
actions: UseTrackedStateActions<T>;
dispatcher: Dispatcher;
getIsDataProcessing: (cacheKey: string) => boolean;
logger: LoggerType;
request: T;
setCacheData: (cacheData: CacheValueType<ExtractResponseType<T>, ExtractErrorType<T>>) => void;
}
Structure
{
actions: {
setData: (data: ExtractResponseType<T>, emitToCache?: boolean) => void;
setError: (error: ExtractErrorType<T>, emitToCache?: boolean) => void;
setExtra: (extra: ExtractAdapterExtraType<ExtractAdapterType<T>>, emitToCache?: boolean) => void;
setLoading: (loading: boolean, emitToHooks?: boolean) => void;
setRetries: (retries: number, emitToCache?: boolean) => void;
setStatus: (status: ExtractAdapterStatusType<ExtractAdapterType<T>>, emitToCache?: boolean) => void;
setSuccess: (success: boolean, emitToCache?: boolean) => void;
setTimestamp: (timestamp: Date, emitToCache?: boolean) => void;
};
dispatcher: Dispatcher;
getIsDataProcessing: (cacheKey: string) => boolean;
logger: Record<LoggerLevelType, (message: LoggerMessageType, ...extra: LoggerMessageType[]) => void>;
request: T;
setCacheData: (cacheData: CacheValueType<ExtractResponseType<T>, ExtractErrorType<T>>) => void;
}